<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<?php
/* 新闻信息修改处理页 */
require_once("../../conn/conn_db.php");   //包含数据库连接文件
if( $_POST["txt_name"]!="" && $_POST["txt_id"]!="" )  //判断新闻标题和编号
{
    $rid = $_POST["txt_id"];           //编号
    $rtid = $_POST["txt_parentid"];    //职位类别编号
    $name = $_POST["txt_name"];      //职位名称
    $city = $_POST["txt_city"];      //工作地区
    $describe = $_POST["txt_describe"];//职位描述
    $createtime = date('Y-m-d'); //发布日期
    
    $sql = "update recruit_info set rt_id=$rtid,r_name='$name',r_city='$city',r_describe='$describe',r_createtime='$createtime' where r_id=".$rid;
    $update = $conn->query($sql); //执行SQL语句
    if($update)                  //判断执行结果
    {
        echo "<script>alert('招聘信息修改成功！');self.location='../recruit_manager.php'</script>";
    }
    else
    {
        echo "<script>alert('招聘信息修改失败！');self.location='../recruit_update.php?r_id=".$rid."'</script>";
    }
}
else
{
    echo "<script>alert('职位类别和职位名称不能为空！');self.location='../recruit_update.php?r_id=".$rid."'</script>";
}
?>
</body>
</html>